/*
 * _DoStack.h
 *
 *  Created on: Oct 18, 2012
 *      Author: wtao
 */

#ifndef DOSTACK_H_
#define DOSTACK_H_

#include "_DoCompositeObject.h"

class _DoStack: public _DoCompositeObject
{
protected:
	_DoStack(const _DoStack&);
	_DoStack& operator=(const _DoStack&);

public:
	_DoStack();
	virtual ~_DoStack();

	void push(CRefPtr< _DoObject > obj);

	CRefPtr< _DoObject > pop();

	CRefPtr< _DoObject > top(size_t i);

	void mark();
	
	void clearToMark();
	
	virtual std::string _debug_dump() const{
		std::ostringstream oss;

		oss << mText << "**";
		oss << _DoCompositeObject::_debug_dump();
		oss << "**";

		return oss.str();
	}
};

#endif /* DOSTACK_H_ */
